home *** CD-ROM | disk | FTP | other *** search
- /*----------------------------------------------------------------------------
-
- genutil.c
-
- This reusable module contains miscellaneous general-purpose
- utility routines.
-
- Copyright ©1995, Northwestern University.
-
- ----------------------------------------------------------------------------*/
-
- #include "genutil.h"
-
-
-
- /*----------------------------------------------------------------------------
- MyTrapAvailable
-
- Check to see if a trap exists.
-
- Entry: theTrap = trap number.
-
- Exit: function result = true if trap exists.
-
- (From NIM:OS Utils p. 8-22)
- ----------------------------------------------------------------------------*/
-
- Boolean MyTrapAvailable (unsigned long theTrap)
- {
- TrapType trapType;
-
- trapType = (theTrap & 0x0800) == 0 ? OSTrap : ToolTrap;
- if (trapType == ToolTrap && (theTrap & 0x3ff) >= 200 &&
- GetToolboxTrapAddress(0xA86E) == GetToolboxTrapAddress(0xAA6E))
- {
- return false;
- } else {
- return NGetTrapAddress(theTrap, trapType) !=
- GetToolboxTrapAddress(_Unimplemented);
- }
- }
-